home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1007 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  3.4 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: jcoffin@rmii.com (Jerry Coffin)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: C++ syntactic trap
  5. Date: 08 Apr 1996 12:20:24 PDT
  6. Organization: TAEUS
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <MPLANET.31696858jcoffin989b4b@news.rmii.com>
  9. References: <4kat8s$2i6k@news.gate.net>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: Mon, 8 Apr 1996 13:26:16 -0600
  12. X-Newsreader: MicroPlanet News32 v1.00 Beta Build 302
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMWlm+Uy4NqrwXLNJAQEBrAIArT1o0ZR74wXuq0gxqXjWolBY5BwxRxU1
  15.     vLOTKpTFULbOsnR/8YMG6hVai3o4UTk+arnuv4dPJaaRNN2DpI07Ww==
  16.     =kyz0
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. In article <4kat8s$2i6k@news.gate.net>, solution@gate.net says...
  20. [ ... ] 
  21.  
  22. > C and C++ are one of the worst syntacticly designed languages around.
  23.  
  24. C and C++ - I believe that's two not one... <G>  I tend to disagree as to the 
  25. meaning of your statement as well.
  26.  
  27. > There is nothing to be done about it without severe redesign (a new
  28. > language) The only one I can think of that is worse is PL/1 where amost
  29. > anything you write has some meaning, just not necessarily what you expect.
  30.  
  31. I'd have to guess that you've never used TECO then.  Nor FORTRAN.  For 
  32. instance, in parsing FORTAN, you have to deal with things like this:
  33.  
  34.     do 10 i=1,10
  35. vs.
  36.     do 10 i=1
  37.  
  38. The first is a do loop, the second a simple assignment of the value 1 to a 
  39. variable named `do 10 i'.  There's no way to know for certain which you're 
  40. looking at until you find whether there's a comma after the `=', so you have 
  41. to either use a backtracking parser, or else several symbols of lookahead.  
  42. Worse, this not only has to be done in the parser, but in the lexer as well, 
  43. since it changes from having three tokens before the `=' to only one token.  
  44. In short, it's about as bad of syntax design as you can find.  IMO, nothing in 
  45. either C or C++ even comes close.
  46.  
  47. > Maybe, as they keep adding features to fix something, the language will
  48. > break from all the syntatic twisting and someone will define a new
  49. > replacement language with a decent syntax covering all the concepts. (Algol
  50. > 00 ?)
  51.  
  52. Hmm...how does one define when a language is "broken" ?  C++ is certainly a 
  53. good deal harder to parse than C or something really simple like LISP, but is 
  54. still quite a bit easier than many others such as FORTRAN or PL/I.  You 
  55. mentioned PL/I above, but may have failed to give a proper idea of how 
  56. difficult it really is to compile; though I suspect this has changed more 
  57. recently, at one time it was claimed that IBM's PL/I level F compiler 
  58. consisted of over 100 passes...  (I don't know how much of this was due to 
  59. language complexity and how much to simply allow the compiler to run in 
  60. minimal memory though.)  I'm not particuarly certain there's a direct 
  61. corollary between difficulty of implementation, and "brokeness", though it 
  62. seems likely that if a language is difficult to implement that individual 
  63. implementations are more likely to be broken.  (Note that here I'm separating 
  64. between the language being broken and the implementation being broken.)
  65.     Later,
  66.     Jerry.
  67. ---
  68. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  69.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  70.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  71.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  72.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  73. ]
  74.